<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<script type="text/javascript" src="../js/comm.js"></script>
<script>
	var i = 2; 

	function initOperatorFace(){
		var columnEmptyContent = "<column name='' dataType='' primaryKey=''></column>";
		var xmlDom = commLoadXML(columnEmptyContent);
		var xslDom = commLoad("addColumn.xsl");
		var columnNode = xmlDom.transformNode(xslDom);
		var divContent = document.getElementById("divContent");
		divContent.innerHTML = columnNode;
	}
	
	function addColumn(obj){
		var columnEmptyContent = "<column name='' dataType='' primaryKey=''></column>";
		var xmlDom = commLoadXML(columnEmptyContent);
		var xslDom = commLoad("addColumn.xsl");
		var columnNode = xmlDom.transformNode(xslDom);
		//alert(columnNode);
		var tb= obj.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
		var row = tb.insertRow(tb.rows.length-1);
		var cell = row.insertCell(0);
		cell.innerHTML = columnNode;
	}
	
	function reduceColumn(obj){
		var tb= obj.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
		var tr =  obj.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
		//alert(tr.rowIndex);
		
		tb.deleteRow(tr.rowIndex);
		//alert("reduceColumn"+obj.xml);
	}
	
	function isPrimaryKey(obj){
		alert("isPrimaryKey:"+obj);
		
	}

	function createTableStrutStr(){
		alert("createTableStrutStr");
	}
</script>
</head>
<body onload=" initOperatorFace" >
<div id="divContent">
</div>
</body>
</html>